package com.ceba.test.modules.log.helper;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ceba.test.base.enums.LogOpTypeEnum;
import com.ceba.test.base.enums.LogTypeEnum;
import com.ceba.test.modules.log.logicService.LogLogicService;

import abc.crypto.MD5;
import configs.context.SpringBeans;
import edu.emory.mathcs.backport.java.util.concurrent.ExecutorService;
import edu.emory.mathcs.backport.java.util.concurrent.Executors;

public class OpLogHelper {

	static ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
	private  static LogLogicService logLogicService = SpringBeans.getLogLogicService("logLogicService");
	static Logger logger = LoggerFactory.getLogger(OpLogHelper.class);
	
	/**
	 * 报告专用版 和 基础版的签名信息记录
	 */
	public static void signOperationLogs(String message) {
		cachedThreadPool.execute(new Runnable() {
			@Override
			public void run() {
				try {
					
					logger.debug(message);
					logLogicService.addLog(LogTypeEnum.SIGN_LOGTYPE.getType(), LogOpTypeEnum.CLOSE_OPYPE.getType(), message,
							"",MD5.getMD5(message));

				} catch (Exception e) {
				}
			}
		});
	}
	
}
